#pragma once

#include "Worker.h"
#include "Lockable.h"

class TimerController : public Singleton<TimerController>, public GameObject, public Worker, public Lockable
{
public:
	TimerController(void);
	~TimerController(void);

	HRESULT SetTimer(UINT every, UINT id, GameObject * object);

	virtual void OnRun(void);

protected:
	struct TIMERDATA
	{
		GameObject * obj;
		UINT next;
		UINT every;
		UINT id;
	};
	typedef vector<shared_ptr<TIMERDATA>> TimerList;
	DWORD _Start;
private:
	TimerList _List;
};

